import Vue from 'vue'
import Router from 'vue-router'
import ShopList from '../components/Shops/ShopList'
import ShopAdmin from '../components/admin/ShopAdmin'
Vue.use(Router)

const originalPush = Router.prototype.replace
Router.prototype.replace = function replace(location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/',
    component: ShopList,
    name:'shiplist',
    meta: {
      refresh: true, // 设置meta属性为true，表示需要刷新页面
    }
  },
  {
    path: '/shopadmin',
    name: 'ShopAdmin',
    component: ShopAdmin,
    meta: {
      refresh: true // 设置meta属性为true，表示需要刷新页面
    }
  }
]
export default new Router({
  mode: 'hash',
  routes
})
